From 206f0bbf7f259868cd434733fd258810fad12281 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 9 Jan 2015 21:12:00 -0500 Subject: [PATCH] GtkScrolledWindow: Factor out a constant Define INDICATOR_CLOSE_DISTANCE instead of hardcoding the same number of pixels in 4 different places. --- gtk/gtkscrolledwindow.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c index f4e85fd990..174f70938d 100644 --- a/gtk/gtkscrolledwindow.c +++ b/gtk/gtkscrolledwindow.c @@ -157,6 +157,7 @@ #define INDICATOR_FADE_OUT_DELAY 2000 #define INDICATOR_FADE_OUT_DURATION 1000 #define INDICATOR_FADE_OUT_TIME 500 +#define INDICATOR_CLOSE_DISTANCE 50 /* Scrolled off indication */ #define UNDERSHOOT_SIZE 40 @@ -990,11 +991,11 @@ event_close_to_indicator (GtkScrolledWindow *sw, } if ((indicator == &priv->hindicator && - y >= win_y - 50 && - y < win_y + indicator_alloc.height + 50) || + y >= win_y - INDICATOR_CLOSE_DISTANCE && + y < win_y + indicator_alloc.height + INDICATOR_CLOSE_DISTANCE) || (indicator == &priv->vindicator && - x >= win_x - 50 && - x < win_x + indicator_alloc.width + 50)) + x >= win_x - INDICATOR_CLOSE_DISTANCE && + x < win_x + indicator_alloc.width + INDICATOR_CLOSE_DISTANCE)) return TRUE; return FALSE; -- 2.30.2